<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateMatchesTable extends Migration
{

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('matches', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('lost_item_id');
            $table->integer('find_item_id');
            $table->integer('match_user_id');
            $table->boolean('confirm')->default(false);
            $table->integer('confirm_user_id');
            $table->timestamps();
            $table->index(['lost_item_id', 'find_item_id']);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('matches');
    }

}
